//
//  DownLoad.h
//  DoewloadDemo
//
//  Created by xalo on 16/6/17.
//  Copyright © 2016年 朱旭东. All rights reserved.
//

#import <Foundation/Foundation.h>
//正在下载
typedef void (^DownLoading)(long long bytesWritten,float  progress);
typedef void (^Complted)(NSString  *filePath ,NSString *url) ;


@interface DownLoad : NSObject
@property (nonatomic,strong) NSURLSession   *session;
@property (nonatomic,strong) NSURLSessionDownloadTask  *task  ;

//重写init方法
- (instancetype)initWithUrl:(NSString*)url;
//开始下载
- (void)startDownLoad;
//暂停下载
- (void)stopDownLoad;

//下载的时候和下载完成会走的方法
- (void)downLoading:(DownLoading)downloading didfinished:(Complted)complted;
@end
